<?php 
include("global.php");
if(true == checkLogin())
{

        session_start();                
        $key_mod =urlencode("rubrica=sms&operation=new");
        $colspan=3;
        
        global $ADMIN;

        $LISTA_RUBRICA_SMS=$_SESSION['LISTA_RUBRICA_SMS'];
        
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>

           
<!--            <script src="files/js/jquery-1.4.2.js" type="text/javascript"></script>
            
            <script src="files/js/jquery.tools.min.js" type="text/javascript"></script>
            <script src="files/js/jquery.tablesorter.js" type="text/javascript"></script>
            <script src="files/js/jquery.tablesorter.pager.js" type="text/javascript"></script>
            <script src="files/js/overlay.js" type="text/javascript"></script>
            
            <script type="text/javascript" src="files/js/core.js"></script>
            <script type="text/javascript" src="files/js/more.js"></script>
            <script type="text/javascript" src="files/js/lang/it.js"></script> 
            
    	<script type="text/javascript" src="files/js/jquery.tools.min.js"></script> 
            <script type="text/javascript" src="files/js/formcheck.js"></script> 
            
            <link media="screen" type="text/css" href="style/form.css" rel="stylesheet" />
            <link media="screen" type="text/css" href="style/formcheck.css" rel="stylesheet" /> 
            <link rel="stylesheet" type="text/css" href="style/overlay-apple.css"/> 
            <link rel="stylesheet" type="text/css" href="style/themes/blue/style.css"/> 
            -->
            <link rel="stylesheet" type="text/css" href="style/overlay-apple.css"/> 
            <link rel="stylesheet" type="text/css" href="style/themes/blue/style.css"/> 

           
   	</head>
           
	<body>
            <div >
                <fieldset>
                <fieldset><legend><b>Rubrica Sms</b></legend>
                    <?php 
                    if($ADMIN == $_SESSION['u_name'])
                    {
                        $colspan=4;
                        print(' <a href="files/php/addnewRubrica.php?key='.$key_mod.'" rel="#overlay" ><img src="img/table-images/new.png"  width="30" height="30" border="0" /></a>');
                    }
                    
                    if(count($LISTA_RUBRICA_SMS) == 0)
                    {
                        print("<h4>Non sono presenti dati nella rubrica Rubrica Sms</h4>
                            </fieldset>
                            </fieldset>
                            <div class=\"apple_overlay\" id=\"overlay\">
			<div class=\"contentWrap\"></div>
                            </div>");
                    }
                    else
                    {
                    ?>
                    
                    <table cellspacing="1" class="tablesorter" id="myTable">
                            <thead>
                                    <tr>
                                            <th>Id</th>
                                            <th>Nome</th>
                                            <th>Azienda</th>
                                            <th>Numero Tel</th>
                                            <?php if($ADMIN == $_SESSION['u_name']) 
                                                print('<th colspan="2">Operazione</th>');
                                            ?>
                                            
                                    </tr>
                            </thead>
                                 <tfoot>
                                <tr>
                                        <td colspan="<?php echo $colspan;?>" class="rounded-foot-left"><em>Elenco elementi rubrica sms</em></td>
                                        <td class="rounded-foot-right">&nbsp;</td>
                                </tr>
                            </tfoot>
                            <tbody>
                                    <?php
                                    printForm($LISTA_RUBRICA_SMS,"sms");
                                    
                                    ?>
                            </tbody>
                    </table>
                    <?php 
                        }
                    ?>
                </fieldset>
                <?php 
                if(count($LISTA_RUBRICA_SMS))
                {
                ?>
                 <div id="pager" class="pager">
                    <form>
                            <img src="images/icon/first.png" class="first"/>
                            <img src="images/icon/prev.png" class="prev"/>
                            <input type="text" class="pagedisplay"/>
                            <img src="images/icon/next.png" class="next"/>
                            <img src="images/icon/last.png" class="last"/>
                            <select class="pagesize">
                                    <option selected="selected"  value="10">10</option>

                                    <option value="20">20</option>
                                    <option value="30">30</option>
                                    <option  value="40">40</option>
                            </select>
                    </form>                       
                </div>
                  <?php } ?>  
                </fieldset>
                </div>
                <br></br>

                
                
                <div class="apple_overlay" id="overlay">
                            <div class="contentWrap"></div>
                </div>
                
	</body>
</html>
<?php
}
else
{
    $arr=explode("/",($_SERVER['PHP_SELF']));
    $url = "http://" . $_SERVER['SERVER_NAME'] . "/index.php";
    $url.= "?url=/Rubrica.php";
    header( "Location: $url" ) ;
    return false;
}
    
?>